package com.yssoft.entity.supplier;

import java.math.BigDecimal;
import java.util.Date;

import com.yssoft.utils.StringUtils;

/**
 * 
    * @ClassName: CirculationInfo
    * @Description:流通信息
    * @author lenovo
    * @date 2018年6月14日
    *
 */
public class CirculationInfo {
	private Integer worksheetId;//加工单id
	private String goodsCode;//销货单号
	private String customName;//客户名称
	private String contacts;//联系人
	private String phone;//联系电话
	private String recAddress;//收货地址
	private String productName;//产品名称
	private String standardNum;//产品标准
	private String specifications;//规格
	private String unit;//单位
	private String orderDate;//订单日期
	private String goodsDetailQuantity;//销货单明细数量
	public String getContacts() {
		return	StringUtils.replaceWithStar(contacts, 1, 0);
	}
	public void setContacts(String contacts) {
		this.contacts = StringUtils.replaceWithStar(contacts, 1, 0);
	}
 
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		if(phone!=null && phone.length()>4) {
			this.phone = StringUtils.replaceWithStar(phone, 2, 0);
		}else {
			this.phone = StringUtils.replaceWithStar(phone, 3, 4);
		}
	}
	public String getRecAddress() {
		return recAddress;
	}
	public void setRecAddress(String recAddress) {
		if(recAddress!=null && recAddress.length()>4) {
			this.recAddress = StringUtils.replaceWithStar(recAddress, 4, 0);
		}else {
			this.recAddress = StringUtils.replaceWithStar(recAddress, 2, 0);
		}
		
	}
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	 
	public String getSpecifications() {
		return specifications;
	}
	public void setSpecifications(String specifications) {
		this.specifications = specifications;
	}
 
	public String getCustomName() {
		return	StringUtils.replaceWithStar(customName, 2, 4);
	}
	public void setCustomName(String customName) {
		//一个字
		if(customName!=null &&customName.length()<2) {
			this.customName = customName;
		//小于7个字的
		}else if(customName!=null &&customName.length()>=2&&customName.length()<7) {
			this.customName = StringUtils.replaceWithStar(customName, 2, 0);
		//大于7个字的
		}else {
			this.customName = StringUtils.replaceWithStar(customName, 2, 4);
		}
		
	}
	public Integer getWorksheetId() {
		return worksheetId;
	}
	public void setWorksheetId(Integer worksheetId) {
		this.worksheetId = worksheetId;
	}
	public String getGoodsCode() {
		return goodsCode;
	}
	public void setGoodsCode(String goodsCode) {
		this.goodsCode = goodsCode;
	}
	public String getStandardNum() {
		return standardNum;
	}
	public void setStandardNum(String standardNum) {
		this.standardNum = standardNum;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}
	public String getGoodsDetailQuantity() {
		return goodsDetailQuantity;
	}
	public void setGoodsDetailQuantity(String goodsDetailQuantity) {
		this.goodsDetailQuantity = goodsDetailQuantity;
	}
	 
}
/*select 
w.id worksheetId,
sg.code  goodsCode,
c.name  customName,c.contacts contacts,c.phone phone, c.rec_address recAddress,
p.name productName,p.standard_num standardNum,p.specifications specifications,p.unit  unit,
DATE_FORMAT ( so.order_date,'%Y-%m-%d')  orderDate,
sgd.quantity  goodsDetailQuantity
from  t_worksheet w 
left join  t_instock_apply_detail id on w.id=id.t_source_id   
left join  t_out_in_stock  ois on  id.id=ois.t_instock_detail_id 
left join  t_outstock_detail od on od.t_outstock_id=ois.t_outstock_detail_id   
left join  t_outstock_apply_detail oad on od.t_out_app_d_id=oad.id
left join  t_sell_goods_detail  sgd on oad.t_source_id= sgd.id
left join  t_sales_order_detail  sod on sod.id=sgd.t_sales_order_d_id
left join  t_sales_order  so on so.id=sod.t_sales_order_id
left join  t_sell_goods  sg on sg.t_sales_order_id=so.id
left join  t_customer  c on c.id=so.t_customer_id
left join  t_products p on sod.t_p_id=p.id
where  od.id is not null*/